﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RaisingStudio.Data.Entities
{
    public partial class _Line : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_Line>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _Line() : base("Line")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _PointID = "PointID";
        public RaisingStudio.Data.Expressions.ColumnExpression PointID { get { return _PointID; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Point = "Point";
        public RaisingStudio.Data.Expressions.ColumnExpression Point { get { return _Point; } }

		#endregion

        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_Line Line)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_Line Line)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(Line);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_Line Line)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            Line.PointID,
                            Line.Point,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }

    
        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_Line>(_Line Line)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_Line>(Line);
        }


        #region IQueryExpression<_Line> 成员

        _Line RaisingStudio.Data.Expressions.IQueryExpression<_Line>.Value
        {
            get { return Line._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class Line
    {
        #region Members
        public static readonly _Line _ = new _Line();
		#endregion
    }
}
